<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        console.log(location);
        // const queryStr = '?username=yuzelin&age=18&profession=sadsad'
        const queryStr = location.search.substr(1);
        const queryArr = queryStr.split('&'); // ['username=yuzelin', 'age=18', 'profession=sadsad']
        // const res = {
        //     username: 'yuzelin',
        //     age: 18,
        //     profession: 'sadsad',
        // };

        const res = {};
        for (const query of queryArr) { // 'username=yuzelin'
            const tmpArr = query.split('='); // ['username', 'yuzelin']
            const key = tmpArr[0];
            const value = tmpArr[1];
            res[key] = value;
        }

        console.log(res);




    </script>
</body>
</html>